IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'RealmsGetRootNodes')
	BEGIN
		DROP  Procedure  RealmsGetRootNodes
	END

GO
-- returns only the root level realm nodes
CREATE Procedure RealmsGetRootNodes
@SagaID int
AS
Select
r.RealmID,
r.SagaID,
r.Title,
r.Summary,
r.ParentID
From Realm r
Where r.SagaID = @SagaID And ParentID=0

GO



